home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / SpriteWorld 2.0 ƒ / SpriteWorld Examples / SpriteTest / Application.h < prev    next >
Encoding:
Text File  |  1996-06-01  |  3.0 KB  |  129 lines  |  [TEXT/KAHL]

  1. ///--------------------------------------------------------------------------------------
  2. //    Application.h
  3. //
  4. //    Created:    Sunday, April 11, 1993
  5. //    By:        Tony Myles
  6. //
  7. //    Copyright: © 1993-94 Tony Myles, All rights reserved worldwide.
  8. ///--------------------------------------------------------------------------------------
  9.  
  10.  
  11. #ifndef __APPLICATION__
  12. #define __APPLICATION__
  13.  
  14. #ifndef __APPLEEVENTS__
  15. #include <AppleEvents.h>
  16. #endif
  17.  
  18.  
  19. enum
  20. {
  21.     kMenuBarResID = 128,
  22.     kWindowResID = 128
  23. };
  24.  
  25. enum
  26. {
  27.     kAppleMenuID = 128,
  28.     kFileMenuID = 129,
  29.     kEditMenuID = 130,
  30.     kSpriteMenuID = 131,
  31.     kTestMenuID = 132
  32. };
  33.  
  34. enum
  35. {
  36.         // file menu
  37.     kAboutItem = 1,
  38.     kQuitItem = 1,
  39.  
  40.         // edit menu
  41.     kUndoItem = 1,
  42.     kCutItem = 3,
  43.     kCopyItem,
  44.     kPasteItem,
  45.     kClearItem,
  46.     kSelectAllItem,
  47.  
  48.         // sprite menu
  49.     kCreateSpriteItem = 1,
  50.     kHideTitleItem = 3,
  51.     kHideBallsItem,
  52.  
  53.         // test menu
  54.     kRunTestItem = 1,
  55.     kSetUpTestItem = 3,
  56.     kCollisionDetectionItem = 5,
  57.     kMonitorDepthItem = 7
  58. };
  59.  
  60. enum
  61. {
  62.     kForeGroundSleepTime = 0,
  63.     kBackGroundSleepTime = 0
  64. };
  65.  
  66. enum
  67. {
  68.     kErrorAlertResID = 128,
  69.     kMonitorDepthResID = 300,
  70.     kErrorStringListResID = 128,
  71.     kUnknownErrorStringIndex = 1,
  72.     kCantFindResourceStringIndex = 2,
  73.     kNotEnoughMemoryStringIndex = 3,
  74.     kCantRunStringIndex = 4
  75. };
  76.  
  77. enum
  78. {
  79.     k1BitDepthButton = 3,
  80.     k4BitDepthButton,
  81.     k8BitDepthButton,
  82.     k16BitDepthButton,
  83.     k32BitDepthButton
  84. };
  85.  
  86.  
  87. #define kSeriousDamageString "\pCould not even get error string!\rThis application is seriously damaged!"
  88.  
  89. /*
  90. pascal    OSErr    SetDialogDefaultItem( DialogPtr theDialog,
  91.                 short newItem ) = { 0x303C, 0x0304, 0xAA68 };
  92. pascal    OSErr    SetDialogCancelItem( DialogPtr theDialog,
  93.                 short newItem ) = { 0x303C, 0x0305, 0xAA68 };
  94. */                
  95.                 
  96. void main(void);
  97. void Initialize(short numberOfMasters);
  98. void CreateMenuBar(void);
  99. void CreateWindow(void);
  100. Boolean EnterApplication(void);
  101. void ExitApplication(void);
  102. void ServiceEvents(void);
  103. void DispatchEvent(EventRecord* event);
  104. void HandleMouseEvent(EventRecord* event);
  105. void HandleKeyEvent(char key, short modifiers);
  106. void HandleUpdateEvent(WindowPtr updateWindowP);
  107. void HandleActivateEvent(WindowPtr updateWindowP);
  108. void HandleOSEvent(long message);
  109. void HandleDiskEvent(long message);
  110. void HandleNullEvent(void);
  111. void HandleMenuCommand(long menuItemIdentifier);
  112. void HandleAppleMenuCommand(short menuItem);
  113. void HandleFileMenuCommand(short menuItem);
  114. void HandleEditMenuCommand(short menuItem);
  115. void HandleSpriteMenuCommand(short menuItem);
  116. void HandleTestMenuCommand(short menuItem);
  117. void AdjustMenuItems(void);
  118. pascal OSErr HandleOpenApp(AppleEvent srcAppleEvent, AppleEvent replyAppleEvent, long refCon);
  119. pascal OSErr HandleOpenDoc(AppleEvent srcAppleEvent, AppleEvent replyAppleEvent, long refCon);
  120. pascal OSErr HandlePrintDoc(AppleEvent srcAppleEvent, AppleEvent replyAppleEvent, long refCon);
  121. pascal OSErr HandleQuit(AppleEvent srcAppleEvent, AppleEvent replyAppleEvent, long refCon);
  122. void MonitorDepthDialog(void);
  123. void SetMonitorDepthButtons( DialogPtr theDialog, short theDepth);
  124. void ErrorAlert(OSErr err, short errorStringIndex);
  125. void CantFindResource(void);
  126. void CantRunOnThisMachine(void);
  127.  
  128.  
  129. #endif /* __APPLICATION__ */